// i.d(t, { Z: () => Animation })
import n from "../math/79437"

export default class Animation {
  isAnimating = true
  duration: number
  startValue: number
  changeValue: number
  easingFunction: Function
  startTime: number | undefined
  constructor(e) {
    this.duration = e.duration
    this.startValue = e.startValue
    this.changeValue = e.endValue - this.startValue
    this.easingFunction = e.easingFunction || n.to
  }
  getUpdatedValue() {
    this.startTime || (this.startTime = Date.now())
    const time = Date.now() - this.startTime
    time > this.duration && (this.isAnimating = !1)
    return this.easingFunction(Math.min(time, this.duration), this.startValue, this.changeValue, this.duration)
  }
}
